Alternative options for creating a serial copy of alpaka modules#43803
Alternative options for creating a serial copy of alpaka modules#43803fwyzard wants to merge 9 commits intocms-sw:masterfrom
Conversation
Co-authored-by: Breno Orzari <breno.orzari@hotmail.com> Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
Co-authored-by: Breno Orzari <breno.orzari@hotmail.com> Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
Rename "gpu" to "device" and "cpu" to "host". Co-authored-by: Breno Orzari <breno.orzari@hotmail.com> Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
Co-authored-by: Andrea Bocci <andrea.bocci@cern.ch> Co-authored-by: Breno Orzari <breno.orzari@hotmail.com> Co-authored-by: Dimitris Papagiannis <nothingface0@gmail.com>
If `module` is an alpaka-based module, `makeSerialClone(module, **args)` will make a copy of `module`, apply the changes in `**args`, and force the copy to run using the "serial_sync" CPU backend.
There was a problem hiding this comment.
I think this is much better than spreading around the direct modification copy._TypedParameterizable__type, and a reasonable way for immediate needs. For the longer term I'd still like to solve the problem in different way, with which I'll follow up in #43780
|
cms-bot internal usage |
|
A new Pull Request was created by @fwyzard (Andrea Bocci) for master. It involves the following packages:
@fwyzard, @subirsarkar, @antoniovilela, @srimanob, @fabiocos, @miquork, @cmsbuild, @davidlange6, @sunilUIET, @syuvivida, @makortel, @rvenditti, @tjavaid, @mandrenguyen, @rappoccio, @perrotta, @antoniovagnerini, @consuegs, @AdrianoDee, @jfernan2, @mmusich, @saumyaphor4252, @nothingface0, @Martin-Grunewald can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
| elif type.startswith('alpaka_serial_sync::'): | ||
| # alpaka module with explicit serial_sync backend | ||
| base = type.removeprefix('alpaka_serial_sync::') |
There was a problem hiding this comment.
The alpaka_serial_sync case could just return module.clone(**kwargs).
| elif type.startswith('alpaka_serial_sync::'): | ||
| # alpaka module with explicit serial_sync backend | ||
| base = type.removeprefix('alpaka_serial_sync::') | ||
| elif type.startswith('alpaka_cuda_async::'): | ||
| # alpaka module with explicit cuda_async backend | ||
| base = type.removeprefix('alpaka_cuda_async::') | ||
| elif type.startswith('alpaka_rocm_async::'): | ||
| # alpaka module with explicit rocm_async backend | ||
| base = type.removeprefix('alpaka_rocm_async::') |
There was a problem hiding this comment.
The if-else chain could be replaced with e.g. a regex to remove the alpaka_[^:]*:: part.
No description provided.